package com.dy.lock.screen.service.impl;

import javax.annotation.Resource;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import com.dy.lock.screen.dao.CustomerFeedbackDao;
import com.dy.lock.screen.pojo.CustomerFeedbackInfo;
import com.dy.lock.screen.service.CustomerFeedbackService;
@Service("customerFeedbackService")
public class CustomerFeedbackServiceImpl implements CustomerFeedbackService {
	
	@Resource(name="customerFeedbackDao")
	private CustomerFeedbackDao customerFeedbackDao;
	
	@Override
	public int save(CustomerFeedbackInfo customerFeedbackInfo) {
		String id = "";
		String maxId = this.customerFeedbackDao.queryMaxId();
		if (StringUtils.isBlank(maxId)) {
			id = "10000000";
		} else {
			id = String.valueOf(Integer.parseInt(maxId) + 1);
		}
		customerFeedbackInfo.setId(id);
		return this.customerFeedbackDao.insert(customerFeedbackInfo);
	}

}
